﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="DangBai.aspx.cs" Inherits="AlumniProject.DangBai1" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>

<asp:Content ID="Content1" ContentPlaceHolderID="contentNoiDung" runat="server">
    <style type="text/css">
        #Contentdiv {
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            margin: auto;
         }
         .noidung {
             margin-top: 10px;
             font-size: 16px;
             color: black;
         }
         .tieude {
             margin-top: 10px;
             margin-bottom: 10px;
             font-size: 16px;
             color: black;
         }
         .texttieude {
             margin-top: 10px;
             margin-bottom: 10px;
         }
         .lbllinhvuc {
             width: 50px;
             float: none;
             margin-left: 150px;
         }
         .submit {
             margin-left: 100px;
             margin-top: 10px;
            font-size: 18px;
            color: #fff; 
            background:#FF6699;
             -ms-border-radius: 7px;
             border-radius: 7px;
	        -ms-box-shadow: 0 0 7px #666;
            border:1px solid #FF6699;
         }

        .ddrlinhvuc {
             width: 150px;
             float: none;
         }
        .hidden {
            display: none;
        }
        div#cke_contentNoiDung_ckeditorbv {
            width: 750px;
        }
    </style>
    <script type="text/javascript">

        function checkSave() {
            var tieude = document.getElementById("<%=txtTieuDe.ClientID%>").value;
            if (tieude.length == 0) {
                alert("Chưa có tiêu đề bài viết!");
                return false;
            } else {
                var id = document.getElementById('<%= ckeditorbv.ClientID %>').id;
                var noidung = CKEDITOR.instances[id].getData();
                document.getElementById('<%=hdfckeditor.ClientID%>').value = noidung;
                document.getElementById('<%=hdfTieuDe.ClientID%>').value = tieude;

                document.getElementById('<%=BtnSubmit.ClientID%>').value = 'Đang đăng bài';

                return true;
            }
        }
    </script>
    <br/>
    <img src="Images/DangTin.png" />
    <br/>
     <div id="Contentdiv">
        <div id="containerdb" class="clear">
            <asp:Label runat="server" Text="Tiêu đề" CssClass="tieude"></asp:Label><br/>
        
            <asp:TextBox runat="server" ID="txtTieuDe" Width="99%" CssClass="texttieude"></asp:TextBox><br/>
            <asp:HiddenField runat="server" ID="hdfTieuDe"/>
            <asp:Label runat="server" Text="Nội dung bài viết" Height="30" CssClass="noidung"></asp:Label>
            <asp:Label runat="server" ID="lblLinhVuc" CssClass="lbllinhvuc" Text="Lĩnh Vực: "></asp:Label>
            <asp:DropDownList ID="ddrLinhVuc" CssClass="ddrlinhvuc" runat="server">
            </asp:DropDownList>
            <asp:Button runat="server" ID="BtnSubmit" Text="Đăng Bài" ViewStateMode="Enabled" CssClass="submit" OnClick="Button1_Click" OnClientClick="return checkSave();"/>
            
            <CKEditor:CKEditorControl ID="ckeditorbv" BasePath="/ckeditor/" runat="server" ></CKEditor:CKEditorControl>
            <asp:HiddenField runat="server" ID="hdfckeditor" Value=""/>
            <div class="row6"></div>
        </div>
        
    </div>
</asp:Content>
